package com.littcore.saap.core.module.message;

import java.io.Serializable;
import java.util.Date;


/**
 * 基础消息.
 * 
 * <pre><b>描述：</b>
 *    消息的基本结构
 * </pre>
 * 
 * <pre><b>修改记录：</b>
 *    
 * </pre>
 * 
 * @author <a href="mailto:littcai@hotmail.com">蔡源</a>
 * @since 2015年10月27日
 * @version 1.0
 */
public class BaseMessage implements Serializable {

  /** The Constant serialVersionUID. */
  private static final long serialVersionUID = 1L;
  
  private String domainCode;
  private String moduleCode;
  private String messageCode;
  
  /** The from by. */
  private int fromBy;
  /** The receive by. */
  private int receiveBy;
  
  private Date createDatetime;
  
  public BaseMessage()
  {
    
  }
  
  /**
   * @param domainCode
   * @param moduleCode
   * @param messageCode
   */
  public BaseMessage(String domainCode, String moduleCode, String messageCode)
  {
    this.domainCode = domainCode;
    this.moduleCode = moduleCode;
    this.messageCode = messageCode;
    this.createDatetime = new Date();
  }
  
  public String getMetaCode()
  {
    return this.domainCode +"-"+this.moduleCode+"-"+this.messageCode;
  }

  
  /**
   * @return the moduleCode
   */
  public String getModuleCode()
  {
    return moduleCode;
  }

  
  /**
   * @param moduleCode the moduleCode to set
   */
  public void setModuleCode(String moduleCode)
  {
    this.moduleCode = moduleCode;
  }

  
  /**
   * @return the messageCode
   */
  public String getMessageCode()
  {
    return messageCode;
  }

  
  /**
   * @param messageCode the messageCode to set
   */
  public void setMessageCode(String messageCode)
  {
    this.messageCode = messageCode;
  }

  
  /**
   * @return the createDatetime
   */
  public Date getCreateDatetime()
  {
    return createDatetime;
  }

  
  /**
   * @param createDatetime the createDatetime to set
   */
  public void setCreateDatetime(Date createDatetime)
  {
    this.createDatetime = createDatetime;
  }


  
  /**
   * @return the domainCode
   */
  public String getDomainCode()
  {
    return domainCode;
  }


  
  /**
   * @param domainCode the domainCode to set
   */
  public void setDomainCode(String domainCode)
  {
    this.domainCode = domainCode;
  }


  
  /**
   * @return the receiveBy
   */
  public int getReceiveBy()
  {
    return receiveBy;
  }


  
  /**
   * @param receiveBy the receiveBy to set
   */
  public void setReceiveBy(int receiveBy)
  {
    this.receiveBy = receiveBy;
  }


  
  /**
   * @return the fromBy
   */
  public int getFromBy()
  {
    return fromBy;
  }


  
  /**
   * @param fromBy the fromBy to set
   */
  public void setFromBy(int fromBy)
  {
    this.fromBy = fromBy;
  }
  
}
